package com.xiao.live.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiao.group.common.utils.PageUtils;
import com.xiao.group.common.utils.Query;

import com.xiao.live.dao.LiveStreamingDao;
import com.xiao.live.entity.LiveStreamingEntity;
import com.xiao.live.service.LiveStreamingService;


@Service("liveStreamingService")
public class LiveStreamingServiceImpl extends ServiceImpl<LiveStreamingDao, LiveStreamingEntity> implements LiveStreamingService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<LiveStreamingEntity> page = this.page(
                new Query<LiveStreamingEntity>().getPage(params),
                new QueryWrapper<LiveStreamingEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public LiveStreamingEntity getbyidlivelist(Integer liveId, Integer goodsId) {
        return baseMapper.selectOne(new QueryWrapper<LiveStreamingEntity>().eq("goods_id", goodsId).eq("live_id", liveId));
    }

}